import request from '@/utils/request'

// 查询订单子列表
export function listInfo(query) {
  return request({
    url: '/prod-api/order/info/list',
    method: 'get',
    params: query
  })
}

// 查询订单子详细
export function getInfo(orderUid) {
  return request({
    url: '/prod-api/order/info/' + orderUid,
    method: 'get'
  })
}

// 新增订单子
export function addInfo(data) {
  return request({
    url: '/prod-api/order/info',
    method: 'post',
    data: data
  })
}

// 修改订单子
export function updateInfo(data) {
  return request({
    url: '/prod-api/order/info',
    method: 'put',
    data: data
  })
}

//订单自提
export function ziTiOrderInfo(data) {
  return request({
    url: '/prod-api/order/info/ziTiOrderInfo',
    method: 'put',
    data: data
  })
}


// 删除订单子
export function delInfo(orderUid) {
  return request({
    url: '/prod-api/order/info/' + orderUid,
    method: 'delete'
  })
}

// 撤销发货
export function revokeShip(orderUid) {
  const data = {orderUid:orderUid}
  return request({
    url: '/prod-api/order/info/revokeShip' ,
    method: 'put',
    data: data
  })
}

// 取消发货
export function cancelShip(orderUid) {
  const data = {orderUid:orderUid}
  return request({
    url: '/prod-api/order/info/cancelShip' ,
    method: 'put',
    data: data
  })
}

//打单
export function getTemplate(orderUid) {
  return request({
    url: '/prod-api/order/info/getTemplate/' + orderUid,
    method: 'get'
  })
}
//添加备注
export function addRemark(data) {
  return request({
    url: '/prod-api/order/info/addRemark',
    method: 'post',
    data: data
  })
}
//开票
export function addInvoice(data) {
  return request({
    url: '/prod-api/order/info/addInvoice',
    method: 'post',
    data: data
  })
}

export function addSubPayinfo(data) {
  return request({
    url: '/prod-api/order/info/addPayInfo',
    method: 'post',
    data: data
  })
}

//订单信息现金统计
export function orderInfoTotal(query) {
  return request({
    url: '/prod-api/order/info/sumList',
    method: 'get',
    params: query
  })
}
